<?php

    global $pid;

    global $productInfo;

    global $productcategoryDAO,$productDAO,$cityDAO,$userDAO,$shopDAO, $sid; 
    
    
    $productName = $productInfo['product_name'];
    $sid = $productInfo['shop_id'];
    $pcid = $productInfo['cate_id'];
    $picURL = $productInfo['pic_path'];
    $price = $productInfo['price'];
    $locationID = $productInfo['location'];
    $productUrl = $productInfo['product_url'];
    $description = $productInfo['description'];    
    $createUserID = $productInfo['create_user_id'];
    $modifyUserID = $productInfo['modify_user_id'];
    $firstUserID = $productInfo['first_user_id'];
    $score = $productInfo['score'];
    $reality = $productInfo['reality'];
    $service = $productInfo['service'];
    $velocity = $productInfo['velocity'];
    $rate = $productInfo['rate'];
    $reviewCount = $productInfo['review_count'];
    $viewCount = $productInfo['view_count'];
    $createTime = $productInfo['create_time'];
    $modifyTime = $productInfo['modify_time'];
    $firstTime = $productInfo['first_time'];
    $status = $productInfo['status'];
   
    $payMethodIDList = $productInfo['paymethod'];
    $featureIDList = $productInfo['feature'];	
    $tag = $productInfo['tag'];	
    $shopName = $productInfo['shop_name'];    
    $platid = $productInfo['plat_id'];
    
    $platType = $platid<5?'店铺':'商城';
    
    
   /*获得feature, paymethod, tag*/
    $featureArr =  $shopDAO->GetShopFeatures($featureIDList);
    $payMethodArr =  $shopDAO->GetShopPayMethods($payMethodIDList);
    $tagArr = $shopDAO->GetShopTags($tag);
    
			
    /*转换platform, category, location*/
    $platform = $shopDAO->GetShopPlatform($platid);
	$productCategory=$productcategoryDAO->GetProductCategoryName($pcid);
	$productLocation=$cityDAO->GetCityNameSimple($locationID);
    
   /*获得推广url*/
	if($platid =='1')
	{//taobao	
		$productInfoPlus=$productDAO->GetProductInfoPlus('taobao',$pid);	  
		if(!edp_is_empty_string($productInfoPlus['click_url']))
		{
	    	$commissionURL = $productInfoPlus['click_url'];
		}
		else
			$commissionURL = $productUrl;
	}
	else if($platid >= '100')
	{//B2C
		require_once(LIB_DIR.'api/cps/b2c.php');
    	require_once(LIB_DIR.'api/cps/yiqifa.php');
  	
	    if($platid == '101')
	    {//当当	
			$commissionURL = GetCPSURL_DANGDANG($productUrl);
			
  		}else if($platid == '102')
	    {//卓越	
			//$commissionURL = GetCPSURL_AMAZON($productUrl);
			$commissionURL = $productUrl;
	    }else {
	     //其他商城   
	     	$commissionURL = $productUrl;
    		//$commissionURL = GetCPSURL($productUrl,$CPSList);	 
	    }
	}
	else 
	{//易趣，拍拍，有啊	
		$commissionURL = $productUrl;
	}

	
	
   $breadcrumb = GetBreadcrumb();
   $breadcrumb->add( "首页", EDP_DOMAIN );
   if($platid < '100')
  	 $breadcrumb->add( $platform, edp_href_link(PAGENAME_PLATFORM,'platid='.$platid) );
  	else 
   	 $breadcrumb->add( '商城', edp_href_link(PAGENAME_PLATFORM,'platid=100') );
   	  	 
   $breadcrumb->add( $shopName, edp_href_link(PAGENAME_SHOP_INFO,'sid='.$sid) );
   $breadcrumb->add( $productName );

	
?>
